package com.xscha.soyue.common.core.exception;

import com.xscha.soyue.common.core.exception.status.CommonStatusCode;
import com.xscha.soyue.common.core.exception.status.SoyStatusCode;
import lombok.Getter;

/**
 * Title: SoyRuntimeException
 *
 * @author Vondser
 * @since V3.0
 */
@Getter
public class SoyRuntimeException extends RuntimeException {

	private static final long serialVersionUID = 886524270431795068L;

	private final SoyStatusCode status;

	public SoyRuntimeException(Throwable throwable) {
		super(throwable);
		this.status = CommonStatusCode.ERROR;
	}

	public SoyRuntimeException(SoyStatusCode status) {
		super(status.getMessage());
		this.status = status;
	}

	public SoyRuntimeException(SoyStatusCode status, String message) {
		super(message);
		this.status = status;
	}

	public SoyRuntimeException(SoyStatusCode status, Throwable cause) {
		super(status.getMessage(), cause);
		this.status = status;
	}

	public SoyRuntimeException(SoyStatusCode status, String message, Throwable cause) {
		super(message, cause);
		this.status = status;
	}

}
